home *** CD-ROM | disk | FTP | other *** search
/ Max Special: Max Gallery / Max Special Gallery.iso / pc / castin.dir / 00001_movie script.ls next >
Encoding:
Text File  |  1997-04-03  |  12.8 KB  |  470 lines

  1. on startMovie
  2.   global slide
  3.   set slide to 0
  4.   reset()
  5.   doMusicGeneral()
  6. end
  7.  
  8. on enterFrame
  9.   set the checkboxType to 0
  10. end
  11.  
  12. on reset
  13.   global myList, ElencoModelle
  14.   set myList to list()
  15.   set ElencoModelle to list()
  16.   VisualizzaTutto(11, 21)
  17.   set the text of field "nome" to " "
  18.   set the text of field "data" to " "
  19.   set the text of field "produzione" to " "
  20.   set the text of field "dati" to " "
  21.   set the checkboxType to 0
  22.   set the hilite of member "1o" to 0
  23.   set the hilite of member "2o" to 0
  24.   set the hilite of member "3o" to 0
  25.   set the hilite of member "4o" to 0
  26.   set the hilite of member "1c" to 0
  27.   set the hilite of member "2c" to 0
  28.   set the hilite of member "3c" to 0
  29.   set the hilite of member "4c" to 0
  30.   set the hilite of member "1s" to 0
  31.   set the hilite of member "2s" to 0
  32.   set the hilite of member "3s" to 0
  33. end
  34.  
  35. on cercaModelle
  36.   global myList, ElencoModelle, indice
  37.   set ElencoModelle to list()
  38.   set choice to costruisciRicerca()
  39.   set occhi to getAt(myList, 4)
  40.   set capelli to getAt(myList, 5)
  41.   set seno to getAt(myList, 6)
  42.   case choice of
  43.     "c":
  44.       verificaAttrib(0, 1, capelli)
  45.     "o":
  46.       verificaAttrib(1, 1, occhi)
  47.     "s":
  48.       verificaAttrib(2, 1, seno)
  49.     "oc":
  50.       verificaAttrib(0, 2, EMPTY)
  51.     "cs":
  52.       verificaAttrib(1, 2, EMPTY)
  53.     "os":
  54.       verificaAttrib(2, 2, EMPTY)
  55.     "ocs":
  56.       verificaAttrib(3, 3, EMPTY)
  57.   end case
  58.   set indice to 1
  59.   if count(ElencoModelle) > 0 then
  60.     go(#next)
  61.     BuildcastingSheet("a")
  62.   else
  63.     alert("Nessun elemento trovato")
  64.   end if
  65. end
  66.  
  67. on verificaAttrib pos, numVal, valore
  68.   global myList, ElencoModelle, listaDatiModelle
  69.   set listaDatiModelle to EMPTY
  70.   set listaDatiModelle to the text of field "DBTXT"
  71.   set numeroLinee to the lineCount of member "DBTXT" - 1
  72.   set occhi to getAt(myList, 4)
  73.   set capelli to getAt(myList, 5)
  74.   set seno to getAt(myList, 6)
  75.   set posizione to 3
  76.   set offset to 9
  77.   case numVal of
  78.     1:
  79.       set valch to EMPTY & valore & EMPTY
  80.       if seno <> -1 then
  81.         repeat with i = 0 to numeroLinee
  82.           set elem to posizione + (i * offset) + pos
  83.           set attributo to item elem of listaDatiModelle
  84.           if ((attributo <= "85") and (seno = 1)) or ((attributo < "90") and (seno = 2)) or ((attributo >= "90") and (seno = 3)) then
  85.             append(ElencoModelle, i + 1)
  86.           end if
  87.         end repeat
  88.       else
  89.         repeat with i = 0 to numeroLinee
  90.           set elem to posizione + (i * offset) + pos
  91.           set attributo to item elem of listaDatiModelle
  92.           if attributo = valch then
  93.             append(ElencoModelle, i + 1)
  94.             put i
  95.           end if
  96.         end repeat
  97.       end if
  98.     2:
  99.       case pos of
  100.         0:
  101.           set chcapelli to EMPTY & capelli & EMPTY
  102.           set chocchi to EMPTY & occhi & EMPTY
  103.           repeat with i = 0 to numeroLinee
  104.             set attribCapelli to item posizione + (i * offset) of listaDatiModelle
  105.             if attribCapelli = chcapelli then
  106.               set attribOcchi to item posizione + (i * offset) + 1 of listaDatiModelle
  107.               if attribOcchi = chocchi then
  108.                 append(ElencoModelle, i + 1)
  109.               end if
  110.             end if
  111.           end repeat
  112.         1:
  113.           set chcapelli to EMPTY & capelli & EMPTY
  114.           repeat with i = 0 to numeroLinee
  115.             set attribCapelli to item posizione + (i * offset) of listaDatiModelle
  116.             if attribCapelli = chcapelli then
  117.               set attribSeno to item posizione + (i * offset) + 2 of listaDatiModelle
  118.               if ((attribSeno <= "85") and (seno = 1)) or ((attribSeno < "90") and (seno = 2)) or ((attribSeno >= "90") and (seno = 3)) then
  119.                 append(ElencoModelle, i + 1)
  120.               end if
  121.             end if
  122.           end repeat
  123.         2:
  124.           set chocchi to EMPTY & occhi & EMPTY
  125.           repeat with i = 0 to numeroLinee
  126.             set attribOcchi to item posizione + (i * offset) + 1 of listaDatiModelle
  127.             if attribOcchi = chocchi then
  128.               set attribSeno to item posizione + (i * offset) + 2 of listaDatiModelle
  129.               if ((attribSeno <= "85") and (seno = 1)) or ((attribSeno < "90") and (seno = 2)) or ((attribSeno >= "90") and (seno = 3)) then
  130.                 append(ElencoModelle, i + 1)
  131.               end if
  132.             end if
  133.           end repeat
  134.       end case
  135.     3:
  136.       set chcapelli to EMPTY & capelli & EMPTY
  137.       set chocchi to EMPTY & occhi & EMPTY
  138.       repeat with i = 0 to numeroLinee
  139.         set attribCapelli to item posizione + (i * offset) of listaDatiModelle
  140.         if attribCapelli = chcapelli then
  141.           set attribOcchi to item posizione + (i * offset) + 1 of listaDatiModelle
  142.           if attribOcchi = chocchi then
  143.             set attribSeno to item posizione + (i * offset) + 2 of listaDatiModelle
  144.             if ((attribSeno <= "85") and (seno = 1)) or ((attribSeno < "90") and (seno = 2)) or ((attribSeno >= "90") and (seno = 3)) then
  145.               append(ElencoModelle, i + 1)
  146.             end if
  147.           end if
  148.         end if
  149.       end repeat
  150.   end case
  151. end
  152.  
  153. on costruisciRicerca
  154.   global myList
  155.   append(myList, the text of field "nome")
  156.   append(myList, the text of field "data")
  157.   append(myList, the text of field "produzione")
  158.   set caso to EMPTY
  159.   set val to -1
  160.   repeat with i = 1 to 4
  161.     set nome to i & "o"
  162.     if the hilite of member nome = 1 then
  163.       set val to i
  164.       put "o" after caso
  165.       exit repeat
  166.     end if
  167.   end repeat
  168.   append(myList, val)
  169.   set val to -1
  170.   repeat with i = 1 to 4
  171.     set nome to i & "c"
  172.     if the hilite of member nome = 1 then
  173.       put "c" after caso
  174.       set val to i
  175.       exit repeat
  176.     end if
  177.   end repeat
  178.   append(myList, val)
  179.   set val to -1
  180.   repeat with i = 1 to 3
  181.     set nome to i & "s"
  182.     if the hilite of member nome = 1 then
  183.       put "s" after caso
  184.       set val to i
  185.       exit repeat
  186.     end if
  187.   end repeat
  188.   append(myList, val)
  189.   return caso
  190. end
  191.  
  192. on BuildcastingSheet premuto
  193.   global ElencoModelle, indice
  194.   inizializzaPaginaModello()
  195.   set numeroElementiLista to count(ElencoModelle)
  196.   case premuto of
  197.     "i":
  198.       set indice to indice - 2
  199.       if indice < 1 then
  200.         set indice to indice + 2
  201.       else
  202.         if indice = 1 then
  203.           set linea1 to getAt(ElencoModelle, indice)
  204.           if numeroElementiLista > 1 then
  205.             set linea2 to getAt(ElencoModelle, indice + 1)
  206.           else
  207.             set linea2 to -1
  208.           end if
  209.         else
  210.           set linea1 to getAt(ElencoModelle, indice - 2)
  211.           if numeroElementiLista > 1 then
  212.             set linea2 to getAt(ElencoModelle, indice - 1)
  213.           else
  214.             set linea2 to -1
  215.           end if
  216.           riempiPagina(linea1, linea2)
  217.         end if
  218.       end if
  219.     "a":
  220.       set linea2 to -1
  221.       if (numeroElementiLista - indice) < 0 then
  222.       else
  223.         if (numeroElementiLista - indice + 1) <> 1 then
  224.           set linea1 to getAt(ElencoModelle, indice)
  225.           set linea2 to getAt(ElencoModelle, indice + 1)
  226.           set indice to indice + 2
  227.           riempiPagina(linea1, linea2)
  228.         else
  229.           set linea1 to getAt(ElencoModelle, indice)
  230.           set indice to indice + 2
  231.           riempiPagina(linea1, -1)
  232.         end if
  233.       end if
  234.   end case
  235. end
  236.  
  237. on inizializzaPaginaModello
  238.   disabilitaTutto(28, 31)
  239.   put " " into field "nome1"
  240.   put " " into field "nome2"
  241.   put " " into field "dati1"
  242.   put " " into field "dati2"
  243.   puppetSprite(35, 0)
  244.   put " " into field "dati"
  245. end
  246.  
  247. on riempiPagina linea1, linea2
  248.   set nomeImm1 to item 1 of line linea1 of field "DBTXT" & ".SMA"
  249.   puppetSprite(28, 1)
  250.   set the memberNum of sprite 28 to the number of member nomeImm1
  251.   spriteBox(28, 50, 64, 133, 184)
  252.   updateStage()
  253.   riempiCampo(linea1, "nome1", "dati1", 0)
  254.   assegnaLogo(30, char 1 of nomeImm1 & "SM.PIC")
  255.   if linea2 <> -1 then
  256.     set nomeImm2 to item 1 of line linea2 of field "DBTXT" & ".SMA"
  257.     puppetSprite(29, 1)
  258.     set the memberNum of sprite 29 to the number of member nomeImm2
  259.     spriteBox(29, 50, 264, 133, 384)
  260.     updateStage()
  261.     riempiCampo(linea2, "nome2", "dati2", 0)
  262.     assegnaLogo(31, char 1 of nomeImm2 & "SM.PIC")
  263.   end if
  264.   updateStage()
  265. end
  266.  
  267. on assegnaLogo whichSprite, nomeImm
  268.   set x to the left of sprite whichSprite
  269.   set y to the top of sprite whichSprite
  270.   puppetSprite(whichSprite, 1)
  271.   set the memberNum of sprite whichSprite to the number of member nomeImm
  272.   spriteBox(whichSprite, x, y, x + the width of member nomeImm, y + the height of member nomeImm)
  273.   updateStage()
  274. end
  275.  
  276. on riempiCampo linea, nomeField1, nomeField2, where
  277.   set nome2 to item 9 of line linea of field "DBTXT"
  278.   set cognome2 to item 8 of line linea of field "DBTXT"
  279.   set altezza2 to item 2 of line linea of field "DBTXT"
  280.   set seno2 to item 5 of line linea of field "DBTXT"
  281.   set vita2 to item 6 of line linea of field "DBTXT"
  282.   set fianchi2 to item 7 of line linea of field "DBTXT"
  283.   if (cognome2 = 0) or (cognome2 = "0") then
  284.     put RETURN & nome2 into field nomeField1
  285.   else
  286.     put RETURN & nome2 & " " & cognome2 into field nomeField1
  287.   end if
  288.   put RETURN after field nomeField1
  289.   put RETURN & altezza2 & " cm" after field nomeField1
  290.   put RETURN after field nomeField1
  291.   put RETURN & seno2 & "-" & vita2 & "-" & fianchi2 after field nomeField1
  292.   updateStage()
  293.   set num to item 4 of line linea of field "DBTXT"
  294.   set colOcchi1 to coloreOcchi(num)
  295.   set num to item 3 of line linea of field "DBTXT"
  296.   set colCapelli1 to coloreCapelli(num)
  297.   if where = 1 then
  298.     put RETURN after field nomeField1
  299.     put RETURN & "Occhi " & colOcchi1 after field nomeField1
  300.     put RETURN after field nomeField1
  301.     put RETURN & "Capelli " & colCapelli1 after field nomeField1
  302.   else
  303.     put RETURN & "Occhi " & colOcchi1 into field nomeField2
  304.     put RETURN after field nomeField2
  305.     put RETURN & "Capelli " & colCapelli1 after field nomeField2
  306.   end if
  307.   if nomeField2 <> EMPTY then
  308.     set the foreColor of member nomeField2 to 0
  309.     set the textFont of member nomeField2 to "Helvetica"
  310.     set the textSize of member nomeField2 to 12
  311.     set the textStyle of member nomeField2 to "Bold"
  312.     updateStage()
  313.   end if
  314. end
  315.  
  316. on calcoloEstremi premuto
  317.   global indice, ElencoModelle
  318.   set q to count(ElencoModelle) / 2
  319.   if ((indice = 3) and (premuto = "i")) or ((indice >= q) and (premuto = "a")) then
  320.     alert("Operazione non permessa")
  321.   else
  322.     if indice <> 0 then
  323.       set s to indice / 2
  324.       if q = s then
  325.         if premuto = "i" then
  326.           set V to 0
  327.         else
  328.           set V to -1
  329.         end if
  330.       else
  331.         if s = 1 then
  332.           if premuto = "a" then
  333.             set V to 0
  334.           else
  335.             set V to -1
  336.           end if
  337.         else
  338.           set V to q - (s + 1)
  339.         end if
  340.       end if
  341.     else
  342.       set V to 0
  343.     end if
  344.   end if
  345.   return V
  346. end
  347.  
  348. on coloreOcchi num
  349.   case num of
  350.     1, "1":
  351.       set colore to "castani"
  352.     2, "2":
  353.       set colore to "neri"
  354.     3, "3":
  355.       set colore to "azzurri"
  356.     4, "4":
  357.       set colore to "verdi"
  358.   end case
  359.   return colore
  360. end
  361.  
  362. on coloreCapelli num
  363.   case num of
  364.     1, "1":
  365.       set colore to "castani"
  366.     2, "2":
  367.       set colore to "neri"
  368.     3, "3":
  369.       set colore to "rossi"
  370.     4, "4":
  371.       set colore to "biondi"
  372.   end case
  373.   return colore
  374. end
  375.  
  376. on NascondiTutto inf, sup
  377.   repeat with i = inf to sup
  378.     puppetSprite(i, 0)
  379.   end repeat
  380. end
  381.  
  382. on VisualizzaTutto inf, sup
  383.   repeat with i = inf to sup
  384.     set the visible of sprite i to 1
  385.   end repeat
  386. end
  387.  
  388. on NascondiAltri whichSprite, inf, sup
  389.   repeat with i = inf to sup
  390.     if i <> whichSprite then
  391.       set the visible of sprite i to 0
  392.     end if
  393.   end repeat
  394. end
  395.  
  396. on testRollOverButton
  397.   if rollOver(4) then
  398.     disabilitaAltri(4, 4, 6)
  399.     flashRoller(4, 34, EMPTY)
  400.   else
  401.     if rollOver(5) then
  402.       disabilitaAltri(5, 4, 6)
  403.       flashRoller(5, 36, EMPTY)
  404.     else
  405.       if rollOver(6) then
  406.         disabilitaAltri(6, 4, 6)
  407.         flashRoller(6, 38, EMPTY)
  408.       else
  409.         disabilitaTutto(4, 6)
  410.       end if
  411.     end if
  412.   end if
  413. end
  414.  
  415. on notAvaRollOverButton
  416.   if rollOver(4) then
  417.     disabilitaAltri(4, 4, 6)
  418.     flashRoller(4, 34, EMPTY)
  419.   else
  420.     if rollOver(6) then
  421.       disabilitaAltri(6, 4, 6)
  422.       flashRoller(6, 38, EMPTY)
  423.     else
  424.       disabilitaTutto(4, 6)
  425.     end if
  426.   end if
  427. end
  428.  
  429. on notIndRollOverButton
  430.   if rollOver(5) then
  431.     disabilitaAltri(5, 4, 6)
  432.     flashRoller(5, 36, EMPTY)
  433.   else
  434.     if rollOver(6) then
  435.       disabilitaAltri(6, 4, 6)
  436.       flashRoller(6, 38, EMPTY)
  437.     else
  438.       disabilitaTutto(4, 6)
  439.     end if
  440.   end if
  441. end
  442.  
  443. on disabilitaAltri whichSprite, inf, sup
  444.   repeat with i = inf to sup
  445.     if i <> whichSprite then
  446.       puppetSprite(i, 0)
  447.     end if
  448.   end repeat
  449. end
  450.  
  451. on disabilitaTutto inf, sup
  452.   repeat with i = inf to sup
  453.     puppetSprite(i, 0)
  454.   end repeat
  455. end
  456.  
  457. on abilitaTutto inf, sup
  458.   repeat with i = inf to sup
  459.     puppetSprite(i, 1)
  460.   end repeat
  461. end
  462.  
  463. on flashRoller whichSprite, numCast, scriptToExecute
  464.   puppetSprite(whichSprite, 1)
  465.   set myCast to numCast
  466.   set the memberNum of sprite whichSprite to myCast + 1
  467.   updateStage()
  468.   do(scriptToExecute)
  469. end
  470.